<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>最佳女王瑜伽培训</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />

 <style>
 body{margin:0px;padding: 0px;}
   a{color:#333;}
  .titleContent{
            padding: 10px 0px;
            background-color: rgba(0,0,0,1);
            border-bottom: 0px solid #ddd;
            margin: 0px;
            position: fixed;
            top: 0px;
            width: 100%;
            min-height:18px;
        }
        #title {
    background-image: url(../images/back.png);
    background-repeat: no-repeat;
    color: #fff;
    font-size: 16px;
    text-align: center;
    font-weight: bold;
    height: 18px;
    overflow:hidden;
    padding: 0px 20px;
    padding-left: 30px;
    line-height: 20px;
}
  img {
      vertical-align: middle;
  }

 #content{overflow: hidden;padding: 5px;margin-top:40px;}

</style>    
</head>
<body>   

<div class="loading" style="background-color: rgba(255, 255, 255, 0.8); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1000; background-image: url(&quot;&quot;); background-position: center center; background-repeat: no-repeat; position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; background-size: 50px;"></div>

    <div class="titleContent" onclick="window.history.back();">
        <div id="title">
            
        </div>
    </div>
<div id="content"></div>   
    <script src="/js/lib/jquery.js"></script>
    <script type="text/javascript">

   function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]); return null;
    }


    function product_loadItem(){
     var Jsondata = {};
    Jsondata.id = GetQueryString("id");
    $.ajax({
                url : "/admin/getcompanyNew",
                method: 'POST',
                data:JSON.stringify(Jsondata),
                dataType: "json",
                success: function (response) {
				var title=response.title.length>12?response.title.substring(0,12)+"...":response.title;
                title=response.title.replace('(首页背景)','').replace('(手机端背景图片)','');
                 if(response.Url!=null&response.Url!=undefined&&response.Url!=""){
                    var iframe="<iframe src='{{url}}' style='height:{{height}};width:100%;border:0px;'></iframe>";
                    iframe=iframe.replace("{{url}}",response.Url).replace("{{height}}",$(window).height().toString()+"px");
                    $("#content").append(iframe);
                    $("#title").html(title)
                 }
                 else{
                    var Resulthtml="";
                    $("#content").append("<div class='newCt'>"+response.content+"</div>");
                    $("#title").html(title)

                    $(".newCt *").css("font-size","15px").css("line-height","28px").css("background-color","#fff");
                    if(response.title=="新闻动态") {
                        var src=$("#content img").attr("src");
                        src=src.replace("../files/upload/","../files/upload/small/");
                        $("#content img").attr("src",src);

                        $("#content").append('<div style="padding:5px 10px;text-align:right;color:#bbb;font-size:12px;border-top:1px solid #ddd;">'+getDate(response.createDate)+'</div>');
                    }
                    $("#content img").css("width", "100%");
                    $("#content img").click(function () { return false;});
                 }
                 $('.loading').delay(0).fadeOut(1000);
             }

           });
}

function getDate(value){
  return (value.substring(0,16).replace("T","日").replace("-","年").replace("-","月"));
}
$(function(){
    $('.page-loading').hide();
    //微信
    if (GetQueryString("id") == 0) {
        $("#title").html("关注微信");
        $("#content").html("<div class='newCt'><img src='../images/weixin.jpg'/></div>");
        $("#content img").css("width", "100%");
        $("#content img").css("border-radios", "3px");
        $('.loading').delay(0).fadeOut(1000);
    }
    else {
        product_loadItem();
    }
});
    </script>      
</body>

</html>
